package my.test.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 许玉康
 * @Date 2019/10/8 9:50
 */
public class Client2 {

    public static void main(String[] args) {
        for (Employee emp : mockEmployee()) {
            emp.accept(new Visitor());
        }
    }

    //模拟出公司的人员情况
    public static List<Employee> mockEmployee() {
        List<Employee> employeeList = new ArrayList<>();
        //产生张三这个员工
        CommonEmployee zhangSan = new CommonEmployee();
        zhangSan.setJob("编写Java程序，绝对的蓝领、苦工家搬运工");
        zhangSan.setName("张三");
        zhangSan.setSalary(1800);
        zhangSan.setSex(Employee.MALE);
        employeeList.add(zhangSan);

        //产生张三这个员工
        CommonEmployee liSi = new CommonEmployee();
        liSi.setJob("页面美工");
        liSi.setName("李四");
        liSi.setSalary(1900);
        liSi.setSex(Employee.FEMALE);
        employeeList.add(liSi);

        //产生张三这个员工
        CommonEmployee wangWu = new CommonEmployee();
        wangWu.setJob("经理");
        wangWu.setName("王五");
        wangWu.setSalary(19000);
        wangWu.setSex(Employee.MALE);
        employeeList.add(wangWu);
        return employeeList;
    }
}
